package me.zhengjie.modules.insurance.pojo;

import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 案件状态
 *
 * @author hehui
 * @date 2022/01/05
 */
@Getter
public enum CaseStatus {

    NOT_HANDLER(0, "待处理", null),
    ALLOCATION(1,"赔理分配", null),
    REPORT(2,"系统报案", null),
    DATA_COLLECTION(3,"资料收集", CaseSpeek.COLLECT_MATERIAL),
    LOSS_DETERMINATION(4,"保险公司定损", CaseSpeek.WAIT_FEE),
    LITIGATION(5,"诉讼", null),
    AGREEMENT_DOC(6,"协议文件", null),
    COMPANY_SEAL(7,"公司盖章", CaseSpeek.WAIT_SEAL),
    CLOSE_CASE(20,"结案", CaseSpeek.OVER),
    PAYMENT(9,"打款", CaseSpeek.WAIT_REMIT),
    WAIT_PAYMENT(10,"待打款", CaseSpeek.WAIT_REMIT),
    ;

    private final int code;

    private final String desc;

    private final CaseSpeek speek;

    CaseStatus(int code, String desc, CaseSpeek speek) {
        this.code = code;
        this.desc = desc;
        this.speek = speek;
    }


    public static CaseStatus codeOf(int code) {
        return Arrays.stream(values()).filter(v -> Objects.equals(code,v.getCode())).findFirst().get();
    }

}
